<?php

declare(strict_types=1);

namespace Modules\Warehouse\Models;

use Catch\Base\CatchModel as Model;

/**
 * @property $id
 * @property $creator_id
 * @property $created_at
 * @property $updated_at
 * @property $deleted_at
 * @property $fmaterial
 * @property $fnumber
 * @property $fname
 * @property $fuseorgid_number
 * @property $fuseorgid_name
 * @property $fdocumentstatus
 * @property $fforbidstatus
*/
class Stash extends Model
{
    

    protected $table = 'stash';

    protected $fillable = [ 'id', 'creator_id', 'created_at', 'updated_at', 'deleted_at', 'fmaterial', 'fnumber', 'fname', 'fuseorgid_number', 'fuseorgid_name', 'fdocumentstatus', 'fforbidstatus' ];

    /**
     * @var array
     */
    protected array $fields = ['id','created_at','updated_at','fmaterial','fnumber','fname','fuseorgid_number','fuseorgid_name','fdocumentstatus','fforbidstatus'];

    /**
     * @var array
     */
    protected array $form = ['id','created_at','updated_at','fmaterial','fnumber','fname','fuseorgid_number','fuseorgid_name','fdocumentstatus','fforbidstatus'];

    /**
     * @var array
     */
    public array $searchable = [
        'fmaterial' => 'like',
        'fnumber' => 'like',
        'fname' => 'like',
        'fuseorgid_number' => 'like',
        'fuseorgid_name' => 'like',
    ];
    
    //输出相应的时间格式
    protected function serializeDate($date)
    {
        //return $date->format('Y-m-d H:i');
        return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
    }

    
}
